import { defineStore } from 'pinia'
const movieStore = defineStore('movie', {
  state: () => ({
    // 选择的城市id数据
    xzCityId: 0,
    xzCityName: '',
    //选择的订单数据，跳转取票页面使用
    selectedOrder: null as any | null
  }),
  getters: {},
  // 定义 action 修改状态
  actions: {
    setXzCityId(id: number) {
      console.log('仓库收到cityid', id)
      this.xzCityId = id
    },
    setXzCityName(mc: any) {
      console.log('仓库收到citymc', mc)
      this.xzCityName = mc
    },
    setSelectedOrder(order: any) {
      console.log('仓库收到dd', order)
      this.selectedOrder = order
    }
  },
  persist: {
    storage: sessionStorage
  }
})
export default movieStore
